<% 
DIRECTIVE SAFE_OUTPUT_OPEN;
var headContent = {
	include("/pages/template/head.html"){}
%>

<script type="text/javascript">
	var oper;
	jQuery(function($) {
		// 页面方法
		oper = {
			form : document.form1,
			list : function() {
				var url = 'admin/home';
				this.form.action = url;
				this.form.submit();
			}
		};
		//显示Menu索引
		showMenu('page_home');
	});
	
</script>

<%
};
%>

<%
var bodyContent = {
%>
	<!-- 菜单 -->
	<% include("/pages/template/menu.html"){} %>

	 <%
	 	// 传递变量  
	 	// 文章列表 articlelist 必填
	 	// 默认图片 defalutimg 选填
	 	var sessionUserId = isEmpty(session.session_user) ? 0: session.session_user.userid;
	 %>
<div class="container" style="margin-top: 10px;">
	<div class="row">
	  <div class="col-md-8">
	  		<% if(!isEmpty(articles)){ %>
	  		<!-- 最新文章 -->
		  	<div class="panel panel-default">
			  <div class="panel-heading">
				<h3 class="panel-title">文章TOP10&nbsp;&nbsp;<a href="admin/article/list" style="font-size: 12px;color:green;">更多</a></h3>
			  </div>
				<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>序号</th>
						<%  // 列表头部 %>
						
						<th>栏目</th> 
						<th>名称</th> 
						<th>排序</th> 
						<th>状态</th> 
						<th>评论</th> 
						<th>推荐</th> 
						<th>发布时间</th> 
						<th>发布者</th> 
					</tr>
				</thead>
				<tbody>
				<% for(item in articles){ %>
					<tr>
						<td>${itemLP.index }</td>
						<%  // 列表内容 %>
						<td>${item.folderName  }</td>
						<td title="${item.title}">
						<a href="front/article/${item.id}.html" class="btn btn-link"  target="_blank">
						<% if (strutil.length(item.title) > 12) { %>
							${strutil.subStringTo(item.title, 0, 12)}...
						<% 	} else { %>
							${item.title}
						<%  } %>
						</a>
						</td> 
						<td>${item.sort}</td>
						<td>
						<% if(item.status=='2') { %>
						隐藏
						<%	} %>
						<% if(item.status=='1') { %>
						显示
						<%	} %>
						</td> 
						<td>
						<% if(item.is_comment==2) { %>
						否
						<%	} %>
						<% if(item.is_comment==1) { %>
						是
						<%	} %>
						</td> 
						<td>
						<% if(item.is_recommend==2) { %>
						否
						<%	} %>
						<% if(item.is_recommend==1) { %>
						是
						<%	} %>
						</td> 
		 				<td>${item.publish_time}</td>
						<td>${item.publish_user}</td> 
						
					</tr>
				<% } %>
				</tbody>
			</table>
		  </div>
	  	  <% } %>
	  		
		  <% if(!isEmpty(comments)){ %>
		  <!-- 最新回复 -->
		  <div class="panel panel-default">
			  <div class="panel-heading">
				<h3 class="panel-title">回复TOP10&nbsp;&nbsp;<a href="admin/comment/list" style="font-size: 12px;color:green;">更多</a></h3>
			  </div>
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>序号</th>
						<%  // 列表头部 %>
						<th>创建时间</th> 
						<th>文章</th> 
						<th>回复人</th> 
						<th>被回复人</th>
						<th>内容</th> 
					</tr>
				</thead>
				<tbody>
				<% for(item in comments){ %>
					<tr>
					<td>${itemLP.index }</td>
						<%  // 列表内容 %>
						<td>${item.create_time}</td>
						<td>
						<a href="front/article/${item.article_id}.html#article_comment" class="btn btn-link"  target="_blank">
						<% if (strutil.length(item.articleName) > 12) { %>
							${strutil.subStringTo(item.articleName, 0, 12)}...
						<% 	} else { %>
							${item.articleName}
						<%  } %>
						</a>
						</td> 
						<td>${flyfox.getUserName(item.create_id)}</td> 
						<td>${flyfox.getUserName(item.reply_userid)}</td> 
						<td title="${flyfox.showHTML(item.content, 200, '...')}">
							${flyfox.showHTML(item.content, 30, '...')}
						</td> 
					</tr>
				<% } %>
				</tbody>
			</table>
		  </div>
	  <% } %>
	  
	  </div>
	  
	  
	  <div class="col-md-4">
	  		<!-- 用户信息 -->
	  		<div class="panel panel-default">
				  <div class="panel-heading">
					<h3 class="panel-title">个人信息&nbsp;&nbsp;<a href="admin/person" style="font-size: 12px;color:green;">编辑</a></h3>
				  </div>
		   		<div class="panel-body">
		  			<form class="form-horizontal" name="form1" action="" method="post">
					<div class="form-group">
					   <label for="username" class="col-sm-3 control-label">登录名</label>
					   <div class="col-sm-9">
					   	${nowUser.username!''}
					   </div>
					 </div>
					 <div class="form-group">
					   <label for="realname" class="col-sm-3 control-label">昵称</label>
					   <div class="col-sm-9">
					     ${nowUser.realname!''}
					   </div>
					 </div>
					<div class="form-group">
					    <label for="email" class="col-sm-3 control-label">email</label>
					    <div class="col-sm-9">
					    	${nowUser.email!''}
					    </div>
					  </div>
					<div class="form-group">
					    <label for="tel" class="col-sm-3 control-label">手机号</label>
					    <div class="col-sm-9">
					      ${nowUser.tel!''}
					    </div>
					  </div>
					  <div class="form-group">
					    <label for="remark" class="col-sm-3 control-label">备注</label>
					    <div class="col-sm-9">
					    	${nowUser.remark!''}
					    </div>
					  </div>
					  </form>
				</div>
			</div>
			
			<% if(!isEmpty(pageViews)){ %>
	  		<!-- 最新访客 -->
	  		<div class="panel panel-default">
			  <div class="panel-heading">
				<h3 class="panel-title">访客TOP10&nbsp;&nbsp;<a href="admin/pageview" style="font-size: 12px;color:green;">更多</a></h3>
			  </div>
			  <ul class="list-group">
			  	<% for(item in pageViews){ %>
			  <li class="list-group-item">
			  <span class="badge">${item.create_time}</span>
			  ${item.ip}(${item.userid})
			  </li>
			  <% } %>
			  </ul>
			</div>
			<% } %>
			
			<% if(!isEmpty(users)){ %>
			<!-- 最新注册用户 -->
		  	<div class="panel panel-default">
			  <div class="panel-heading">
				<h3 class="panel-title">注册用户TOP10&nbsp;&nbsp;<a href="system/user/list" style="font-size: 12px;color:green;">更多</a></h3>
			  </div>
			  <ul class="list-group">
			  	<% for(item in users){ %>
			  <li class="list-group-item">
			  <span class="badge">${item.create_time}</span>
			  用户：${item.realname}<br>邮箱：${item.email}
			  </li>
			  <% } %>
			  </ul>
			</div>
			<% } %>
			
			
	</div>

</div>

<%}; %>

<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
DIRECTIVE SAFE_OUTPUT_CLOSE;
<%} %>
